﻿<local:DocumentBase x:Class="WPFExcelReport.HomeDocument"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:DOCUMENT"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:my="clr-namespace:WPFExcelReport"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls" 
                    Background="White" 
                    FontSize="14"
                    Title="文件审批" ToolTip="Home" IsCloseable="False">
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <db:SETDOCUMENT x:Key="dataSource" />
        <CollectionViewSource  x:Key="vwKDSTAMM" Source="{Binding Path=KDSTAMM,Source={StaticResource dataSource}}"/>
        <CollectionViewSource  x:Key="vwVKKOPF" Source="{Binding Path=VKKOPF,Source={StaticResource dataSource}}"/>
        <CollectionViewSource  x:Key="vwVKPOS" Source="{Binding Path=VKPOS,Source={StaticResource dataSource}}"/>
    </local:DocumentBase.Resources>
    <Grid Background="{x:Null}" Height="736" HorizontalAlignment="Stretch" Width="1000">
        <StackPanel>
        <Expander IsExpanded="True" Header="连接服务"  Name="zoneService"  VerticalAlignment="Top" HorizontalAlignment="Stretch">
                <StackPanel>
                    <WrapPanel Grid.Row="0" Grid.Column="2" Grid.ColumnSpan="4">
                        <Label Content="系统" Width="40" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <TextBox Name="txtMANDANT" MaxLength="2" Width="40" Margin="10,0,0,0" Text="00" HorizontalAlignment="Left" Background="Pink" FontSize="14" TabIndex="1" />
                        <Label Content="语言" Width="40" Margin="0,0,0,0" HorizontalAlignment="Left" FontSize="14" VerticalAlignment="Center" />
                        <TextBox IsReadOnly="True" Name="txtSPRACHKZ" Width="40" Margin="0,0,0,0" Text="" MaxLength="1" HorizontalAlignment="Left" Background="Pink" FontSize="14" TabIndex="2" />
                        <Label Content="用户名" Width="60" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="14" VerticalAlignment="Center" />
                        <TextBox Name="txtUserID" Width="80" Margin="10,0,0,0" Text="" HorizontalAlignment="Left" Background="Yellow" FontSize="14" MaxLength="8" AcceptsTab="False" CharacterCasing="Upper" KeyboardNavigation.TabIndex="0" TabIndex="3" />
                        <Label Content="密码" Width="40" Margin="10,0,0,0" HorizontalAlignment="Left" FontSize="14" VerticalAlignment="Center" />
                        <PasswordBox Name="txtPassword" Width="80" Margin="10,0,0,0" HorizontalAlignment="Left" Background="Yellow" FontSize="14" KeyboardNavigation.TabIndex="1" TabIndex="4" />
                        <Button Height="Auto" Margin="10,0,0,0" Name="btnLogIn" Width="34" Click="btnLogIn_Click" KeyboardNavigation.TabIndex="2" IsDefault="True" TabIndex="5">
                            <Button.Background>
                                <ImageBrush ImageSource="/IntexReportClient;component/Images/User.png" />
                            </Button.Background>
                        </Button>
                        <Label  Margin="20,0,0,0" Name="label2"  Width="Auto">职务</Label>
                       <ComboBox Margin="10,0,0,0" Name="userType" SelectedIndex="0" IsEnabled="False" MinWidth="100">
                                <ComboBoxItem Content="文员" />
                                <ComboBoxItem Content="主管" />
                                <ComboBoxItem Content="经理" />
                                <ComboBoxItem Content="总经理" />
                            </ComboBox>                
                    </WrapPanel>              
                    <WrapPanel>
                        <Button Height="Auto" FontSize="14" HorizontalAlignment="Left" Margin="45,0,0,0" Name="discover" VerticalAlignment="Top" Width="114" Click="discover_Click">搜索Web服务器</Button>
                        <Button Margin="10,0,0,0" Name="disconnect" VerticalAlignment="Bottom" Width="79" Click="disconnect_Click" IsEnabled="False" Content="退订"></Button>
                        <Button Margin="10,0,0,0" Name="connect" Click="connect_Click" IsEnabled="False" Width="79" Content="订阅"></Button>
                    </WrapPanel>           
                </StackPanel>
            </Expander>
            <Expander Header="文档准备"  Name="zoneDocument" HorizontalAlignment="Stretch" VerticalAlignment="Top" IsExpanded="True">
                <WrapPanel>
                    <StackPanel>
                        <WrapPanel>
                            <Label Height="28" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="Auto">文档类型</Label>
                            <ComboBox FontSize="14" HorizontalAlignment="Left" Height="23" Margin="15,0,0,0" Name="documentType" Width="120" SelectedIndex="0" >
                                <ComboBoxItem Content="客户信用报警" />
                                <ComboBoxItem Content="报价审核" />
                            </ComboBox>
                            <Button Content="查询" Height="Auto" Margin="14,10,0,0" Name="btnQueryCustomer" Width="134" Click="btnQueryCustomer_Click" />
                            <Label Height="28" HorizontalAlignment="Left" Margin="10,10,0,0" Name="label3" VerticalAlignment="Top" Width="Auto">审批类型</Label>
                        <ComboBox FontSize="14" HorizontalAlignment="Left" Height="23" Margin="15,0,0,0" Name="approvalType" Width="120" SelectedIndex="0" IsEnabled="False">
                            <ComboBoxItem Content="主管确定" />
                            <ComboBoxItem Content="经理确定" />
                            <ComboBoxItem Content="总经理确定" />
                        </ComboBox> 
                        </WrapPanel>                       
                        <WrapPanel>
                            <Button Height="23" HorizontalAlignment="Left" Margin="14,0,0,0"     Name="btnCreateDoc"  Width="Auto" Click="btnCreateDoc_Click">产生文档</Button>
                            <Button Height="23" HorizontalAlignment="Left" Margin="14,0,0,0"     Name="requestApproval"  Width="Auto" IsEnabled="False" Click="requestApproval_Click">申请审批</Button>
                            <Button Content="取消" IsEnabled="False" Height="Auto" Margin="14,0,0,0" Name="CancelRequest" Width="Auto" Click="CancelRequest_Click" />
                        </WrapPanel>
                        <WrapPanel> 
                            <Label HorizontalAlignment="Left" Margin="14,0,0,0" Name="label4" Height="23" Width="Auto">文件名称</Label>
                            <TextBox HorizontalAlignment="Left" Margin="14,0,0,0" Name="docName" Width="300" Height="25" Background="Wheat"  IsEnabled="False" />
                        </WrapPanel>                        
                        <WrapPanel> 
                            <ListBox FontSize="10" Margin="14,10,0,0" Name="PendingList" Width="250" Height="200" SelectionChanged="PendingList_SelectionChanged" />
                            <ListBox FontSize="10" Height="200" HorizontalAlignment="Left" Margin="14,10,0,0" Name="ApprovedList" Width="250" />
                        </WrapPanel>
                    </StackPanel>
                    <StackPanel>
                        <DataGrid 
                                ItemsSource="{Binding Source={StaticResource vwKDSTAMM}}" 
                                RowDetailsVisibilityMode="VisibleWhenSelected"
                                AutoGenerateColumns="False" 
                                Height="Auto" 
                                Width="400"
                                MaxHeight="150"
                                MinHeight="150"
                                HorizontalScrollBarVisibility="Auto"
                                VerticalScrollBarVisibility="Auto" 
                                >
                            <DataGrid.Columns>
                                <DataGridTextColumn  Binding="{Binding Path=KDKUNDNA, Converter={StaticResource ResourceKey=gb2312}}" Header="客户" Width="Auto" />
                                <DataGridTextColumn  Binding="{Binding Path=KDKUNDNR}" Header="编号" Width="120" />
                                <DataGridTextColumn  Binding="{Binding Path=KDNAME1, Converter={StaticResource ResourceKey=gb2312}}" Header="全名" Width="200" />
                            </DataGrid.Columns>
                        </DataGrid>
                        <Label Margin="0,0,0,0" Name="label5" HorizontalAlignment="Left" Width="200">预览文件内容</Label>
                    <TextBox Margin="0,0,0,0" FontSize="10" Name="document" HorizontalAlignment="Left" Width="400" Height="200" IsEnabled="False"  Background="Wheat"/>
                    </StackPanel>
                </WrapPanel>
            </Expander>
            <Expander Header="审批过程"  Name="zoneApproval" VerticalAlignment="Bottom" IsExpanded="True" HorizontalAlignment="Stretch">
                <WrapPanel>
                    <StackPanel>
                        <ListBox Margin="5,5,0,5" Name="approvalList" HorizontalAlignment="Left" Width="400" Height="400" IsEnabled="True" SelectionChanged="approvalList_SelectionChanged" />
                     </StackPanel>
                    <StackPanel>
                        <WrapPanel  Margin="10,0,0,0"  HorizontalAlignment="Left">
                            <Button Height="32" Width="32" Margin="0,0,0,0" Name="approve" IsEnabled="False" Click="approve_Click">
                                <Button.Background>
                                    <ImageBrush ImageSource="/IntexReportClient;component/Resources/Images/32x32/button_ok.png" />
                                </Button.Background>
                            </Button>
                            <Button HorizontalAlignment="Right" Margin="40,0,0,0" Name="reject" Width="32" Height="32" VerticalAlignment="Bottom" IsEnabled="False" Click="reject_Click">
                                <Button.Background>
                                    <ImageBrush ImageSource="/IntexReportClient;component/Resources/Images/32x32/button_cancel.png" />
                                </Button.Background>
                            </Button>
                        </WrapPanel>
                        <Label>文档名称</Label>
                        <TextBox Height="23" Margin="10,0,0,0" Name="titleReview" Width="400" IsEnabled="False"  />
                        <Label>文档浏览</Label>
                        <TextBox Margin="10,0,0,0" Name="docReview" Width="400" Height="300" IsEnabled="False" />
                    </StackPanel>
                </WrapPanel>
        
            </Expander>
        <TextBox Height="87" Margin="24,0,26,12" Name="statusConsole" VerticalAlignment="Bottom" AcceptsReturn="True" IsReadOnly="True" TextWrapping="WrapWithOverflow" VerticalScrollBarVisibility="Visible" IsEnabled="True" />
        <Label Content="日志" Height="28" HorizontalAlignment="Left" Margin="26,0,0,92" Name="label6" VerticalAlignment="Bottom" Width="120" />
        </StackPanel>
    </Grid>
</local:DocumentBase>
